<?php
/**
 * Created by PhpStorm.
 * User: lincanbin
 * Date: 2018/3/20
 * Time: 17:26
 */

namespace business\base\services;


class SystemConfigService
{
    /**
     * 根据配置key获取 配置值
     * @param $configKey
     * @param $defaultValue
     * @return null|string
     */
    public static function  get($configKey,$defaultValue='')
    {
        $sql = 'select config_value from b2b_parameter.sysp_config  where config_key=:configKey ';
        $ret =  \Yii::$app->db->createCommand($sql, [':configKey' => $configKey])->queryScalar();
        return !empty($ret) ? $ret : $defaultValue;
    }
}